<div>
    <?php foreach ($chapters as $chapter){ ?>
        <div><?php echo $chapter['name']; ?></div>
    <?php } ?>
</div>

    <div>
    <?php foreach ($chapters as $chapter){ ?>
            <div><?php echo $chapter['name']; ?></div>
    <?php } ?>
</div>
